package com.ruoyi.mall.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.PrimaryKeyIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.ProductTagBindMapper;
import com.ruoyi.mall.api.domian.ProductTagBind;
import com.ruoyi.mall.service.IProductTagBindService;

/**
 * 商品标签绑定Service业务层处理
 *
 * @author luogongquan
 * @date 2024-10-10
 */
@Service
public class ProductTagBindServiceImpl implements IProductTagBindService
{
    @Autowired
    private ProductTagBindMapper productTagBindMapper;

    /**
     * 查询商品标签绑定
     *
     * @param id 商品标签绑定主键
     * @return 商品标签绑定
     */
    @Override
    public ProductTagBind selectProductTagBindById(Long id)
    {
        return productTagBindMapper.selectProductTagBindById(id);
    }

    /**
     * 查询商品标签绑定列表
     *
     * @param productTagBind 商品标签绑定
     * @return 商品标签绑定
     */
    @Override
    public List<ProductTagBind> selectProductTagBindList(ProductTagBind productTagBind)
    {
        return productTagBindMapper.selectProductTagBindList(productTagBind);
    }

    /**
     * 新增商品标签绑定
     *
     * @param productTagBind 商品标签绑定
     * @return 结果
     */
    @Override
    public int insertProductTagBind(ProductTagBind productTagBind)
    {
        productTagBind.setId(PrimaryKeyIdUtils.getSysIdWorker().nextId());
        return productTagBindMapper.insertProductTagBind(productTagBind);
    }

    /**
     * 修改商品标签绑定
     *
     * @param productTagBind 商品标签绑定
     * @return 结果
     */
    @Override
    public int updateProductTagBind(ProductTagBind productTagBind)
    {
        return productTagBindMapper.updateProductTagBind(productTagBind);
    }

    /**
     * 批量删除商品标签绑定
     *
     * @param ids 需要删除的商品标签绑定主键
     * @return 结果
     */
    @Override
    public int deleteProductTagBindByIds(Long[] ids)
    {
        return productTagBindMapper.deleteProductTagBindByIds(ids);
    }

    /**
     * 删除商品标签绑定信息
     *
     * @param id 商品标签绑定主键
     * @return 结果
     */
    @Override
    public int deleteProductTagBindById(Long id)
    {
        return productTagBindMapper.deleteProductTagBindById(id);
    }
}
